<template>
	<view class="license">
		<view class="box bg-white">
			<template v-if="images.length">
				<view v-for="(item, index) in images" :key="index" class="m-b-25" @click="viewImage(index)">
					<u-image :src="item" width="100%" height="348rpx">
					</u-image>
				</view>
			</template>
			<template v-else>
				<view class="data-null xs muted">
					<image :src="$getImageUri('resource/image/shopapi/uniapp/empty/order.png')" mode=""></image>
					<view>
						{{$zhTran('商家暂时还没有上传资质哦~')}}
					</view>
				</view>
			</template>
		</view>
	</view>
</template>

<script>
	import {
		apiCopyright
	} from "@/api/user";
	export default {
		data() {
			return {
				images: []
			}
		},

		methods: {
			async getCopyrightFunc() {
				this.images = await apiCopyright()
			},

			viewImage(current) {
				uni.previewImage({
					current,
					urls: this.images // 需要预览的图片http链接列表
				});
			}
		},

		onLoad() {
			this.getCopyrightFunc()
			if (this.$Route.meta.atitle) {
				uni.setNavigationBarTitle({
					title: this.$zhTran(this.$Route.meta.atitle)
				})
			}
		}
	}
</script>

<style lang="scss">
	.license {
		padding: 30rpx;

		.box {
			padding: 30rpx;
			border-radius: 16rpx;

			.data-null {
				padding-top: 200rpx;
				height: 700rpx;
				text-align: center;

				image {
					width: 200rpx;
					height: 200rpx;
				}
			}
		}
	}
</style>